package com.github.ecbp.common.constant;

public class CacheKeyConstant {
    public static final String UNKNOWN = "unknown";

    public static final String APPLET = "APPLET";

    //项目名
    public static final String PROJECT_NAME = "/ecbp";
    //feign版本号
    public static final String FEIGN_VERSION = "/feign/v1";

    public static final String PHONE = "PHONE";
    public static final String KEY = "KEY";
    public static final String IP = "IP";
    public static final String OS = "OS";
    public static final String OPENID = "OPENID";
    public static final String CODE = "CODE";

    public static final String PATH_SEPARATOR = ":";
    // 用户信息
    public static final String ADMIN_PREFIX = "ADMIN";
    // 用户token
    public static final String TOKEN_PREFIX = "TOKEN";
    // 用户验证码
    public static final String CODE_PREFIX = "CODE";
    // 微信用户登录临时token
    public static final String APPLET_LOGIN_PREFIX = "APPLET_SESSION";
    // 所有权限信息
    public static final String SECURITY_KEY = "AUTH_SECURITY_METADATA_SOURCE";

    // 用户信息
    public static final String USERINFO_IN_REDIS = "authorization:{" + KEY + "}:{" + PHONE + "}";
    // 用户信息+IP
    public static final String TOKEN_IN_REDIS_WITH_IP = "authorization:{" + KEY + "}:{" + PHONE + "}:{" + IP + "}";
    // 用户token 注销用
    public static final String TOKEN_IN_REDIS = "AUTHORIZATION:{" + KEY + "}:{" + PHONE + "}:*";
    // 验证码
    public static final String CODE_IN_REDIS = "captcha:{" + KEY + "}:{" + IP + "}:{" + OS + "}";
    // 微信会话信息
    public static final String WECHAT_CODE_IN_REDIS = "WECHAT:{" + KEY + "}:{" + OPENID + "}";
    // 短信验证码
    public static final String VERIFICATION_IN_REDIS = "VERIFICATION:{" + KEY + "}:{" + PHONE + "}";
}
